import java.util.Arrays;

public class test {
    public static int[] seekNumber(int [] arr){
        int i = 0;
        for (int j = 0; j < arr.length; j++) {
            i ^= arr[j];
        }
        int n = 1;
        while (true) {
            if ((i & n) == n) {
                break;
            } else {
                n *= 2;
            }
        }
        int [] count = {0,0};
        for (int k = 0; k < arr.length; k++) {
            if((arr[k] & n) == 0){
                count[0] ^= arr[k];
            }else {
                count[1] ^= arr[k];
            }
        }
        return count;
    }
    public static void main(String[] args) {
        int[] arr = {1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,11};
        int[] arr1 = seekNumber(arr);
        System.out.println(Arrays.toString(arr1));
    }
}
